package com.qire.manhua.view.adapter.pager;

import android.view.View;

import com.qire.common.collect.ArrayUtil;
import com.qire.common.collect.ListUtil;
import com.qire.common.widget.adapter.pager.BasePagerAdapter;

import androidx.annotation.Nullable;

public class ComicRankListPagerAdapter extends BasePagerAdapter {

    private final CharSequence[] titleArray;

    public ComicRankListPagerAdapter(CharSequence[] titleArray) {
        super(ListUtil.newArrayListWithExpectedSize(titleArray.length));
        this.titleArray = titleArray;
    }

    public void replaceTitleArray(CharSequence[] titleArray) {
        ArrayUtil.replace(titleArray, this.titleArray);
    }

    public void addPagerView(View view) {
        mListViews.add(view);
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return titleArray[position];
    }

}
